var app = require('express')()
var server = require('http').createServer(app)
var io = require('socket.io')(server)

app.set('view engine', 'ejs')
app.set('views', __dirname + "/public")
app.set('view options', {
  layout: false
})


io.on('connection', function(socket) {
  console.log("已连接");
  console.log(socket.id);
  socket.on('hello', function(data) {
    console.log(data)
  })
  io.on('disconnect', function() {

  })
})
server.listen(3000)

// const io=require('socket.io')(app)






app.get('/', (req, res) => {
  res.render('index')
})
// server.listen(3000)
